import React, { FC, useEffect } from 'react'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import MyHead from '../../components/MyHead'
import { getMyComments } from '../../redux/actions'

const MyComments:FC<any> = ({
  userInfo,
  MyComments,
  dispatch
}) => {
//  请求数据
  useEffect(()=>{
    dispatch(getMyComments({
      phone:userInfo.phone
    }))
  },[])
  return (
    <div>
        <MyHead title='我的评论'/>
       
    </div>
  )
}

export default connect(
    // 拿到数据
    (state:any)=>{
        console.log(state);
        return{
          // 得到数据
          userInfo:state.getIn(['data','userInfo']),
          MyComments:state.getIn(['data','MyComments'])
        }
    }
) (MyComments)